package cn.xfdzx.android.apps.shop.contract;

import cn.xfdzx.android.apps.shop.base.BaseView;
import cn.xfdzx.android.apps.shop.bean.BaseObjectBean;
import cn.xfdzx.android.apps.shop.bean.ConfirmGoodBeen;
import cn.xfdzx.android.apps.shop.bean.FamilyBuyBeen;
import cn.xfdzx.android.apps.shop.bean.FoundGoodTitleBeen;
import cn.xfdzx.android.apps.shop.bean.GoodsLimitBean;
import cn.xfdzx.android.apps.shop.bean.GoodsMiaoSBean;
import cn.xfdzx.android.apps.shop.bean.HomeMarketInitDataBeen;
import cn.xfdzx.android.apps.shop.bean.HomeMarketSelectBeen;
import cn.xfdzx.android.apps.shop.bean.LoginBean;
import cn.xfdzx.android.apps.shop.bean.SelfOwnedShopBeen;
import io.reactivex.Flowable;


/**
 * @author azheng
 * @date 2018/6/4.
 * Description：
 */

public interface HomeMarketContract {
    interface Model {
        Flowable<BaseObjectBean<HomeMarketInitDataBeen>> initData();

        Flowable<HomeMarketSelectBeen> initSelectData(String pages, String limit);

        Flowable<SelfOwnedShopBeen> selfOwnedShop(String limit);


        //限量活动列表
        Flowable<GoodsLimitBean> getGoodsLimitList(String limit, int page);

        //秒杀活动列表
        Flowable<GoodsMiaoSBean> getGoodsMiaoShaList(String limit, int page);

        //分类标题
        Flowable<FoundGoodTitleBeen> initTitle(String pid, String index_status);

        //家庭购
        Flowable<FamilyBuyBeen> familyBuy(String sales_model);

        //加入购物车
        Flowable<ConfirmGoodBeen> addCar(String is_new, String uniqueId, String productId, String cartNum);


    }

    interface View extends BaseView {
        @Override
        void showLoading();

        @Override
        void hideLoading();

        @Override
        void onError(Throwable throwable);

        void onInitDataSuccess(BaseObjectBean<HomeMarketInitDataBeen> bean);

        void onInitSelectDataSuccess(HomeMarketSelectBeen bean);

        void onSelfOwnedShopSuccess(SelfOwnedShopBeen bean);


        void onFamilyBuySuccess(FamilyBuyBeen bean);

        void getGoodsLimitListSuccess(GoodsLimitBean bean);

        void getGoodsMiaoShaListSuccess(GoodsMiaoSBean bean);

        void onInitTitleSuccess(FoundGoodTitleBeen bean);
        /**
         * 刷新完成
         */
        void finishRefresh();

        /**
         * 加载完成
         */
        void finishLoadMore();

        void onAddCarSuccess(ConfirmGoodBeen bean,int position,int total_num);

    }

    interface Presenter {
        /**
         * 首页 市场采购
         * 初始化数据
         */
        void initData();

        void selfOwnedShop(String limit);

        void initSelectData(boolean isRefresh, boolean isLoading, String pages, String limit);


        void getGoodsLimitList(boolean isRefresh, boolean isLoading, String limit, int page);

        void getGoodsMiaoShaList(boolean isRefresh, boolean isLoading, String limit, int page);
        void initTitle(String pid,String index_status);

        void familyBuy(String sales_model );


        void addCar(String is_new,String uniqueId,String productId,String cartNum,int position,int total_num);

    }
}
